﻿$().ready(function () {
    $("#breadcrumb").append('<li><a href="' + $("#urlCompany").val() + '" title="Información de la Empresa">Información de la Empresa</a></li>');
    $("#optCompany").addClass("HoverOnList");

    $('#imgPhoto').live('click', function () {
        $("#filePhoto").trigger("click");
    });

    var thumb = $('#imgPhoto');
    var thumb2 = $('#imgPhotoPreview');
    if (!(typeof thumb[0] === "undefined")) {
        new AjaxUpload('imgPhoto', {
            action: $("#urlUploadPhoto").val(),
            name: 'image',
            onSubmit: function (file, extension) { },
            onComplete: function (file, response) {
                $("#urlphoto").val(response);
                var url = '/ODSYSUI/Content/Images/Uploads/Organization/' + response;
                thumb.attr('src', url);
                thumb2.attr('src', url);
            }
        });
    }
});

function SubmitForm() {
    if ($("#frmCompany").valid()) {
        document.forms['frmCompany'].submit();
    }
}